package com.sangeng.controller;

import com.sangeng.domain.dto.RoleSearchParamsDTO;
import com.sangeng.domain.vo.PermissionTreeVO;
import com.sangeng.domain.vo.Result;
import com.sangeng.domain.vo.RoleSearchVO;
import com.sangeng.service.IPermissionService;
import com.sangeng.service.IRoleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/system")
@Slf4j
public class RoleController {
    @Resource
    private IRoleService roleService;

    /**
     * 分页查询角色信息
     */
    @PostMapping("/role/list")
    public Result<RoleSearchVO> pageList(@RequestBody RoleSearchParamsDTO roleSearchParamsDTO){
        log.info("分页查询角色信息：{}",roleSearchParamsDTO);
        RoleSearchVO roleSearchVO = roleService.pageList(roleSearchParamsDTO);
        return Result.ok(roleSearchVO);
    }

}
